package com.shirley.dbExample.service.impl;

import com.shirley.dbExample.entity.Salary;
import com.shirley.dbExample.repository.SalaryRepository;
import com.shirley.dbExample.service.SalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SalaryServiceImpl extends CrudServiceImpl<Salary, Long> implements SalaryService {

    private SalaryRepository salaryRepository;
    @Autowired
    public SalaryServiceImpl(JpaRepository<Salary, Long> salaryRepository) {
        super(salaryRepository);
        this.salaryRepository = (SalaryRepository) salaryRepository;
    }

    @Override
    public List<Salary> findByEmployeeNum(String employeeNumber) {
        return salaryRepository.findByEmployeeNumber(employeeNumber);
    }
}
